doctype html
block page-type
  - var pageType = "default"
html(class=pageType)
  include ./head
  body
    #wrap
      block content
      .clear-foot
      include ./nav
    block foot
      include scripts
    block script
      script.
        $('.nav a').each(function (index, item) {
          if (typeof current !== 'undefined' && ~item.href.indexOf(current)) {
            $(item).parent().addClass('current');
            return false;
          }
        });

        var photoPopup = function (el, size) {
          size = size || '320px';
          var mask = $('<div></div>'),
            img = $('<img>'),
            halfSize = (parseInt(size, 10) / 2) + 'px';

          $('body').append(mask).append(img);

          mask.css(
            {
              display:    'none',
              height:     '100%',
              width:      '100%',
              position:   'fixed',
              left:       '0',
              top:        '0',
              background: '#aaa',
              opacity:    "0.5",
              zIndex:     '98'
            }
          );

          img.css(
            {
              display:  'none',
              height:   size,
              width:    size,
              position: 'fixed',
              left:     '50%',
              marginLeft: '-' + halfSize,
              top:      '50%',
              marginTop: '-' + halfSize,
              zIndex:   '99'
            }
          );

          img.on('click', function () {
            img.css('display', 'none');
            mask.css('display', 'none');
            document.ontouchmove = null;
          });

          mask.on('click', function () {
            img.css('display', 'none');
            mask.css('display', 'none');
            document.ontouchmove = null;
          });

          $(el).on('click', function (e) {
            img.attr('src', $(e.target).data('src'));
            img.css('display', 'block');
            mask.css('display', 'block');
            document.ontouchmove = function (evt) {
              evt.preventDefault();
            };
          })};
